package cn.dcw.pethome.system.service.impl;

import cn.dcw.pethome.basic.service.impl.BaseServiceImpl;
import cn.dcw.pethome.system.domain.DictionaryDetail;
import cn.dcw.pethome.system.mapper.DictionaryDetailMapper;
import cn.dcw.pethome.system.service.IDictionaryDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/*
部门管理
 */
@Service

public class DictionaryDetailServiceImpl extends BaseServiceImpl<DictionaryDetail> implements IDictionaryDetailService {
    //加载部门mapper
    @Autowired
    private DictionaryDetailMapper mapper;

    //添加部门
    @Override
    @Transactional
    public void add(DictionaryDetail dictionaryDetail) {
        mapper.add(dictionaryDetail);
       this.update(dictionaryDetail);
    }


  @Override
    @Transactional
    public void update(DictionaryDetail dictionaryDetail) {
        mapper.update(dictionaryDetail);
    }

    /**
     * 二级联动
     * @return
     */
   @Override
    public List<DictionaryDetail> getTree() {
        return mapper.getTree();
    }

    @Override
    public List<DictionaryDetail> findDetailes(Long id) {
        return mapper.findDetailes(id);
    }
}
